package io.renren.wechat.common;


import com.alibaba.fastjson.annotation.JSONField;

public class WechatResponse {

    @JSONField(serialize = false)
    private Integer errcode;

    @JSONField(serialize = false)
    private String errmsg;


    public boolean isSuccess() {
        return null != errcode && 0 == errcode;
    }

    public boolean isError() {
        return errcode != null && 0 != errcode;
    }

    public Integer getErrcode() {
        return errcode;
    }

    public void setErrcode(Integer errcode) {
        this.errcode = errcode;
    }

    public String getErrmsg() {
        return errmsg;
    }

    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }

    @Override
    public String toString() {
        return "WechatResponse{" +
                "errcode=" + errcode +
                ", errmsg='" + errmsg + '\'' +
                '}';
    }
}
